Skip to content

Fix problem in unapply typing. #177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Sep 21, 2014

GADT bound resetting may only be applied when comparing
<: , not when comparing the
other way around.

The fix revealed an error in a test case (t1048) which looks like a real error.
Therefore the test got moved to neg.

Fixes #175 Review by @DarkDimius

GADT bound resetting may only be applied when comparing
<pattern type> <: <expected type>, not when comparing the
other way around.

The fix revealed an error in a test case (t1048) which looks like a real error.
Therefore the test got moved to neg.
@DarkDimius
Copy link
Contributor

after applying this commit to patmat branch new type-comparrer related errors appeared:

assertion failed: error at ./tests/pos/typers.scala:145
type mismatch:
 found   : String(x)
 required: String

While Y-checking a block
Block(List(ValDef(Modifiers(,,List()),x,TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,lang)),String)],EXPR),Block(List(),Ident(x)))
with an expected type of String.

@odersky
Copy link
Contributor Author

odersky commented Sep 23, 2014

It looks like there's something deeper going on. Did you run with -uniqid and -Xexplain-types. In cases like these you want to see the precise failed subtyping derivation.

@DarkDimius
Copy link
Contributor

assertion failed: error at ./tests/pos/Patterns.scala:41
type mismatch:
 found   : String#6032(x#31720)
 required: String#6032
Constraint(
 uninstVars = ;
 constrained types = ;
 constraint = )
Subtype trace:
  ==> String#6032(x#31720) <:< String#6032
  <== String#6032(x#31720) <:< String#6032 = false

@DarkDimius
Copy link
Contributor

incorporated in #174

@DarkDimius DarkDimius closed this Sep 26, 2014
WojciechMazur pushed a commit to WojciechMazur/dotty that referenced this pull request Mar 19, 2025
Backport "fix: drop jackson-module-scala from CB" to 3.3 LTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect infering "Nothing" as a type argument of fun in 'Unapply'
2 participants